package com.we.wecc.bk.api.controller;

import com.we.wecc.bk.db.model.BankCard;
import com.we.wecc.bk.mid.service.BankService;
import com.we.wecc.us.db.model.User;
import com.x.share.api.controller.BaseController;
import com.x.share.mid.exception.HelperException;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

@Api(value = "银行部分接口")
@RestController
@RequestMapping("/wecc/bk")
public class BankController extends BaseController {

    @Resource
    BankService bankService;

    @ApiOperation(value = "校验银行卡号", notes = "校验银行卡号", response = BankCard.class)
    @RequestMapping(value = "/verifyBankNo", method = {RequestMethod.GET})
    public @ResponseBody Map<String, Object> verifyBankNo(
            @ApiParam(value = "银行卡号") @RequestHeader("bankNo") String bankNo,
            @ApiParam(value = "应用id") @RequestHeader("appId") String appId,
            @ApiParam(value = "应用accessToken") @RequestHeader("atk") String atk) throws HelperException {
        BankCard bc = bankService.verifyBankNo(bankNo);
        return success(bc);
    }
}